package com.gupao.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.gupao.model.ResultMap;

@RestController
@RequestMapping("/unauthorized")
public class NoAuthController {
	private static final Logger log = LoggerFactory.getLogger(NoAuthController.class);
	
	private ResultMap resultMap=new ResultMap();
	
	@GetMapping(value = "/denied")
    public String denied() {
        log.info("小伙子权限不足,别无谓挣扎了...");
        return "denied...";
    }
	
	@GetMapping(value = "{message}")
	public ResultMap message(@PathVariable String message) {
		log.info("小伙子权限不足,别无谓挣扎了...");
		return resultMap.fail().code(401).message(message);
	}
	
}
